//
//  WelcomeViewController.swift
//  weibo_yaoye
//
//  Created by mac on 15/5/18.
//  Copyright (c) 2015年 mac. All rights reserved.
//

import UIKit

//--------------step 55---自动登录的欢迎界面----------------------------------------------------------

class WelcomeViewController: UIViewController {

    @IBOutlet weak var bottomDistance: NSLayoutConstraint!
    
    @IBOutlet weak var welcomeLabel: UILabel!
    override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)
        bottomDistance.constant =  view.bounds.size.height - bottomDistance.constant
        
        UIView.animateWithDuration(2.5, delay: 0, usingSpringWithDamping: 0.85, initialSpringVelocity: 5, options: nil, animations: { () -> Void in
            self.view.layoutIfNeeded()
        }) { (_) -> Void in
         

        UIView.animateWithDuration(0.2, animations: { () -> Void in
            self.welcomeLabel.alpha = 1.0
        }, completion: { (_) -> Void in
            println("OK")
            NSNotificationCenter.defaultCenter().postNotificationName(YYChooseRootVCNotification, object: "Main")
        })
            
        }
    }
    
    
    
    
    
    
  
    
    override func viewDidLoad() {
        super.viewDidLoad()

    }
}
